package qldc.pm.tiensu.searchcontainer.util.yeucautrichluc;

import com.liferay.portal.kernel.util.OrderByComparator;

public class YeuCauTrichLucSearchUtil {

	public static OrderByComparator getYeuCauTrichLucOrderByComparator(String orderByCol, String orderByType) {
		boolean orderByAsc = false;

		if(orderByType.equals("asc")) {
			orderByAsc = true;
		}

		OrderByComparator orderByComparator = null;

		if (orderByCol.equals("hoVaTenNguoiYeuCauTrichLuc")) {
			orderByComparator = new HoVaTenNguoiYeuCauTrichLucComparator(orderByAsc);
		} else if(orderByCol.equals("coQuanYeuCauTrichLuc")) {
			orderByComparator = new CoQuanNguoiYeuCauTrichLucComparator(orderByAsc);
		} else if(orderByCol.equals("hoVaTenDoiTuongTrichLuc")) {
			orderByComparator = new HoVaTenDoiTuongTrichLucComparator(orderByAsc);
		} else if(orderByCol.equals("soDinhDanhCaNhanDoiTuongTrichLuc")) {
			orderByComparator = new SoDinhDanhCaNhanDoiTuongTrichLucComparator(orderByAsc);
		} else if(orderByCol.equals("soCMNDDoiTuongTrichLuc")) {
			orderByComparator = new SoCMNDDoiTuongTrichLucComparator(orderByAsc);
		} else if(orderByCol.equals("soSoHoKhauDoiTuongTrichLuc")) {
			orderByComparator = new SoSoHoKhauDoiTuongTrichLucComparator(orderByAsc);
		}else if(orderByCol.equals("createDate")) {
			orderByComparator = new NgayLapYeuCauTrichLucComparator(orderByAsc);
		}else if(orderByCol.equals("maYeuCauTrichLuc")) {
			orderByComparator = new MaYeuCauTrichLucComparator(orderByAsc);
		}

		return orderByComparator;
	}

}
